Normalize forum subject/body HTML storage and migrate legacy encoded content#1872
Draft
Normalize forum subject/body HTML storage and migrate legacy encoded content#1872
Conversation
Agent-Logs-Url: https://github.com/DNNCommunity/Dnn.CommunityForums/sessions/f8e33658-1dbe-4328-a9f4-483db63bd83d Co-authored-by: johnhenley <9553126+johnhenley@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DNNCommunity/Dnn.CommunityForums/sessions/f8e33658-1dbe-4328-a9f4-483db63bd83d Co-authored-by: johnhenley <9553126+johnhenley@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update HTML encoding logic for subject and body
Normalize forum subject/body HTML storage and migrate legacy encoded content
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subject/body encoding has drifted over time, resulting in mixed raw/encoded values in
activeforums_Contentand inconsistent rendering/email behavior. This PR standardizes persistence to store unencoded content and aligns rendering/token paths to avoid double-decoding.Storage normalization (single boundary)
Utilities.NormalizeHtmlForStorage(...)to decode HTML entities once before persistence.SqlDataProvider.Topics_Save,SqlDataProvider.Reply_Save, and post submit flow inaf_post.ascx.cs), including topic summary.Rendering/token alignment
HtmlDecode(...)in key read/render/edit mappings where data should now already be normalized:TopicView/TopicsViewcontent hydrationaf_post.ascx.csTokenReplacer.ReplaceBody(...)decode pathUpgrade data conversion
sql/09.07.00-1607.SqlDataProviderto normalize existingactiveforums_Content.SubjectandBodyvalues (including doubly encoded legacy patterns).DnnCommunityForums.dnn.activeforums_Topics_Save,activeforums_Reply_Save,activeforums_Topics_SaveToForum).Utility coverage
Utilities.NormalizeHtmlForStorage(...)inUtilitiesTests(single decode behavior, empty/null handling).